$('#header').load('header.php',function(){
    var ul = document.getElementsByTagName('ul')[0];
    var div = document.getElementsByClassName("item");
    var subNav = document.getElementById("subNav");
    /***导航栏***/
//鼠标进入事件
    ul.addEventListener('mouseover', function (e) {
        var target = e.target;
        target.parentNode.style.display = "block";
        target.parentNode.className = "hover";
        for (var i = 0; i < div.length; i++) {
            var divs = div[i];
            if (target.parentNode.parentNode.className == divs.id) {
                var ids = document.getElementById(divs.id);
                ids.style.display = "block";
                ids.style.top = 0;
            }
        }
    }, false);
//鼠标退出事件
    ul.addEventListener("mouseout", function (e) {
        var target = e.target;
        for (var i = 0; i < div.length; i++) {
            var divs = div[i];
            divs.style.display = "none";
            target.parentNode.className = "";
        }
    })
//导航下拉菜单鼠标事件
    for (var i = 0; i < div.length; i++) {
        div[i].addEventListener("mouseover", function () {
            this.style.display = "block";
            var ids = document.getElementsByClassName(this.id);
            ids[0].children[0].className = "hover";

        });
        div[i].addEventListener("mouseout", function () {
            this.style.display = "none";
            var ids = document.getElementsByClassName(this.id);
            ids[0].children[0].className = "";
        });
    }

});
$('#footer').load('footer.php');


